package demo2;

class B{
    public int num=1;
    public B(){
        func();
    }
    public void func(){
        System.out.println("B.func()");
    }
}
class D extends B{
    public  int num=0;
    public void func(){
        System.out.println("D.func(),num="+num);//没有机会把num变为1
    }
}
public class Test8 {
    public static void main(String[] args){
        D d=new D();
    }
}
